

import 'package:courseapp/page/teacher/index/TeacherAllCourse.dart';
import 'package:courseapp/page/teacher/index/TeacherTodayCourse.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class TeacherIndex extends StatefulWidget {

  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
     return TeacherState();
  }

}

class TeacherState extends State {

  Map page = {0:TeacherTodayCourse(),
  1:TeacherAllCourse()};
  int currentIndex = 0;


  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      body: page[currentIndex],
      bottomNavigationBar: BottomNavigationBar(
          unselectedFontSize: 10,
          selectedFontSize: 10,
          unselectedItemColor: Colors.grey,
          selectedItemColor: Colors.blue,
          currentIndex: currentIndex,
          items: [
            BottomNavigationBarItem(icon:Icon(Icons.school) ,title: Text("今日课程")),
            BottomNavigationBarItem(icon: Icon(Icons.dashboard), title: Text("全部课程")),
          ],
          onTap: (index) {
            currentIndex = index;
            setState(() {});
          },
      ),
    );

  }


}